/**
 * @author yusak
 */
 // add Search Menu Buttons
ChaShaKu.TaskButtons = Ext.extend(Ext.app.Module,{
	id: 'searchMenuButtons',
	init: function(){
		// prepare strings search menu
		this.listByStrings = new Ext.menu.Item({
			iconCls: 'wordList',
			text: 'make a word list'
		});
		this.centerListByStrings = new Ext.menu.Item({
			iconCls: 'wordList',
			text: 'make a word list (center words)'
		});
		this.strings = new Ext.Toolbar.SplitButton({
			iconCls: 'find',
			text: 'Strings Search',
			tooltip: {text:'入力された文字列を含む文を検索します', title:'文字列検索', autoHide:true},
			menu:{items:[this.listByStrings,this.centerListByStrings]}
		});
		
		// prepare words search menu
		this.listByWords = new Ext.menu.Item({
			iconCls: 'wordList',
			text: 'make a word list'
		});
		this.centerListByWords = new Ext.menu.Item({
			iconCls: 'wordList',
			text: 'make a word list (center words)'
		});
		this.words = new Ext.Toolbar.SplitButton({
			iconCls: 'find',
			text: 'Words Search',
			tooltip: {text:'入力された単語を含む文を検索します', title:'単語検索', autoHide:true},
			menu: {items:[this.listByWords,this.centerListByWords]}
		});
		
		// prepare advanced search menu
		this.advanced = new Ext.Toolbar.Button({
			iconCls: 'find',
			text: 'Advanced Search',
			tooltip: {text:'単語列による検索やリスト生成などを行います', title:'詳細検索', autoHide:true}
		});
	},
	run: function(){
		this.app.viewport.toolbar.add(this.strings,this.words,this.advanced);
	}
});
